home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / asm / Tandem.lha / Tandem / Teaching / 13.asm < prev    next >
Encoding:
Assembly Source File  |  1999-08-21  |  761 b   |  15 lines

  1. * 13.asm   Shift and rotate        version 0.00    1.9.97
  2.  
  3.  move.l #$44442222,d0  ;LSR shifts right, zero fills
  4.  lsr.l #1,d0           ;(each shift=unsigned halve, CS if 1 falls out)
  5.  move.l #$44442222,d0  ;LSL shifts left, zero fills
  6.  lsl.l #1,d0           ;(each shift=unsigned double, CS if 1 falls out)
  7.  move.l #$FFFF4444,d0  ;ASR shifts right, fills w. leftmost digit
  8.  asr.l #8,d0           ;(each shift=signed halve, CS if 1 falls out)
  9.  move.l #$FFFF4444,d0  ;ASL same as LSL
  10.  asl.l #8,d0           ;(each shift=signed halve, CS if 1 falls out)
  11.  move.l #$12345678,d0  ;ROL shifts all to left, bit that falls out
  12.  rol.l #4,d0           ;pushed into other and and also to C flag
  13.  ror.l #4,d0           ;(ROL #4 rotates digits, since each digit=4 bits)
  14.  rts
  15.